import { createStore } from 'redux'
import { composeWithDevTools } from '@redux-devtools/extension'

const initState = {
  num: 100
}

const reducer = (state = initState, { type, payload }) => {
  if ('add' === type) {
    return { ...state, num: state.num + payload }
  }
  return state
}

const store = createStore(reducer, composeWithDevTools())

export default store
